<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"      
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
    <h:head>
        <title>Employees</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <link href="css/plugins/dataTables.bootstrap.css" rel="stylesheet" type="text/css"/>
    </h:head>
    <h:body>
        <ui:composition template="com.template/AdminTemplate.xhtml">
            <ui:define name="page-content">
                <div class="row">
                    <ol class="breadcrumb" style="background-color: #fff;">                        
                        <li><a href="#">Blue Pumpkin</a></li>
                        <li class="active">Employees</li>                        
                    </ol>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading btn-group">
                        <button type="button" class="btn btn-sm btn-primary" data-toggle="collapse" data-target="#myCollapse">
                            Registration of event #{showEmployees.eventId} <i class="fa fa-group fa-fw"></i>
                        </button>
                        <a href="createemployee.xhtml" class="btn btn-sm btn-danger">Create Employee <i class="fa fa-plus"></i></a>
                    </div>
                    <div id="myCollapse" class="panel-collapse collapse in">
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-sm-12">
                                    <c:forEach var="i" items="#{showEmployees.registers}">
                                        <div class="col-sm-3 col-xs-4 text-center">
                                            <a href="profile.xhtml?emId=#{i.username}">
                                                <img class="img-responsive img-circle" src="#{i.avatar}" alt=""/>
                                            </a>
                                            <h5 class="text-center">
                                                <a href="#">#{i.fullname}</a>
                                            </h5>                                
                                            <span class="label label-primary text-muted small ">
                                                <i class="fa fa-briefcase fa-fw"></i>#{i.position}</span><br/>                                                    
                                            <span class="text-muted small">
                                                <i class="fa fa-sitemap fa-fw"></i>#{i.departments}</span><br/>
                                            <span class="text-muted small"> 
                                                <i class="fa fa-clock-o fa-fw"></i>#{i.logged}</span>
                                            <br/>
                                            <br/>                                
                                        </div>
                                    </c:forEach>                                    
                                </div>                    
                            </div>                            
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-12">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <strong><i class="fa fa-table fa-fw"></i>Employees Table</strong>
                            </div>
                            <!-- /.panel-heading -->
                            <div class="panel-body">
                                <div class="table-responsive">
                                    <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                        <thead>
                                            <tr>
                                                <th class="text-center"><i class="fa fa-image fa-fw"></i></th>
                                                <th class="text-center"><i class="fa fa-user fa-fw"></i></th>
                                                <th class="text-center"><i class="fa fa-key fa-fw"></i></th>
                                                <th class="text-center"><i class="fa fa-envelope fa-fw"></i></th>
                                                <th class="text-center"><i class="fa fa-briefcase fa-fw"></i>Position</th>
                                                <th class="text-center"><i class="fa fa-sitemap fa-fw"></i>Department</th>                                                                                                                    
                                                <th class="text-center"><i class="fa fa-clock-o fa-fw"></i>Last logged</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <c:forEach var="i" items="#{showEmployees.employees}">
                                                <tr class="odd gradeX">
                                                    <td class="text-center">
                                                        <img class="img-responsive" src="#{i.avatar}" alt="" height="40" width="40"/>
                                                    </td>
                                                    <td>
                                                        <a href="#">#{i.fullname}</a>    
                                                    </td>
                                                    <td>#{i.username}</td>
                                                    <td>#{i.email}</td>
                                                    <td>#{i.position}</td>
                                                    <td>#{i.departments}</td>
                                                    <td>#{i.logged}</td>
                                                </tr>                                                                      
                                            </c:forEach>
                                        </tbody>                                                            
                                    </table>
                                </div>
                                <!-- /.table-responsive -->                                                    
                            </div>
                            <!-- /.panel-body -->
                        </div>
                        <!-- /.panel -->
                    </div>
                </div>
            </ui:define>
        </ui:composition>
        <!-- DataTables JavaScript -->        
        <script src="js/plugins/dataTables/dataTables.bootstrap.js" type="text/javascript"></script>
        <script src="js/plugins/dataTables/jquery.dataTables.js" type="text/javascript"></script>        
        <script type="text/javascript">
            // events table
            $(document).ready(function() {
                $('#dataTables-example').dataTable();
            });
        </script>
    </h:body>
</html>
